<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 transitional//EN">
<html>
<head>
<title>Data Item Element</title>
<link rel="stylesheet" href="../style/style.css" type="text/css"/>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<h1>Data</h1>

<p>Displays a data set or computed value with optional 
formatting.</p>

<h3>Description</h3>

<p>A data element displays data from a data set, an 
expression, a parameter, etc. Data items display the value of a column, 
parameter or expression. Data items are for use with grids, containers, 
matrices, tables and other items that need a short, discrete data value.</p>

<p>Data items allow Java-like multi-part formats: One of the 
common formats used by some people is: #,##0_);(#,##0);&quot;---&quot;. See the Style 
element for a description of the available styles.</p>

<p>BIRT applies one of the predefined styles depending on 
the data value of the item. If the expression returns a number, then BIRT 
applies the <code>number</code> style. If the expression 
returns a string, then BIRT applies the <code>string</code> 
style. And, if the expression returns a date, then BIRT applies the
<code>date</code> style.</p>

<h3>See Also</h3>

<p>Label element</p>
<p>Multi-line Data element</p>
<p>Style element</p>

<h2 class="method">onCreate</h2>
<p>Script executed when the element is created in the Factory.</p>

<h3>Description</h3>
<p>Executed when the element is created in the Factory. Called after the item is created, but before 
the item is saved to the report document file. See the scripting spec for additional information 
about this script. Applications should perform visual customization in the on-render script instead.</p>

<h2 class="method">onPrepare</h2>
<p>It is for a script startup phase. No data binding yet. The design of an element can be changed here.</p>

<h3>Description</h3>
<p>It is for a script startup phase. No data binding yet. The design of an element can be changed here.</p>

<h2 class="method">onRender</h2>
<p>Script executed when the element is prepared for rendering in the Presentation engine.</p>

<h3>Description</h3>
<p>Executed when the element is prepared for rendering in the Presentation engine. Changes made to the 
element are written to the target output format, but not saved to the report document file. This is the
preferred place for visual customizations.</p>
<h2 class="property">action</h2>

<p>Optional hyperlink defined for the data item.</p>

<h3>Description</h3>

<p>Optional hyperlink defined for the data item. Like the 
value expression, the hyperlink is computed, and can link to a different 
resource for each data item instance.</p>

<h3>See Also</h3>

<p>Action structure</p>

<h2 class="property">helpText</h2>

<p>Optional tool-tip text that appears when the user hovers the cursor over the item.</p>

<h3>Description</h3>

<p>Reports often display large amounts of data on a single 
page. Data items are often short. While this works well once the user is 
familiar with the meaning of each data string/value, it can make the report 
confusing to the first-time user. Help-text helps bridge the gap. It allows the 
user to display a number, such as the Return on Investment (ROI) for an asset in 
the report. If the user needs more information, he can hover the cursor over the 
label and help text will appear that says something like, &quot;Return on Investment: 
defined as the ratio of profit to funds invested.&quot;</p>

<p>The help text is optional. If no text is present, then no 
tool-tip text will appear. The help text can be externalized. The help text is 
static, it cannot vary for each data item.</p>

<h3>See Also</h3>

<h2 class="property">resultSetColumn</h2>

<p>The bound column name refers to the value to display in the item.</p>

<h3>Description</h3>

<p>The bound column name refers to the value to display in the item. 
Through the boudn column, it can also reference a report parameter, a 
formula, a special value or other data item.</p>

<p>The expression is usually evaluated when the report is 
rendered, not in the Factory, though it may be evaluated in the Factory also. 
Expressions should depend only on variables and objects available both in the 
Factory and Presentation Engine. See the <i>ROM Scripting Specification</i> for 
details.</p>

<p>BIRT automatically determines the type of formatting to 
apply based on the actual return value of each expression. If the return value 
is a Number, BIRT applies numeric formatting. If the return value is a Date, 
BIRT applies date/time formatting. If the return value is a String, BIRT applies 
string formatting. The data item itself does not have a type; the type is 
computed independently for each and every data item based on the return value of 
this expression.</p>

<h3>See Also</h3>
</body>
</html>